﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace canyinguanlixitong
{
    public partial class frmas3cha : Form
    {
        public frmas3cha()
        {
            InitializeComponent();
        }
        string str = "Data Source=.;Initial Catalog=Supermarket management system;Integrated Security=True";
        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        //窗体加载
        private void frmas3cha_Load(object sender, EventArgs e)
        {
            jiazai();
        }
        public void jiazai() {
            SqlConnection conn = new SqlConnection(str);
            conn.Open();
            string sql = "select id,idquan,appone,phone,beizhu from dbo.jinguocaigou";
            DataSet ds = new DataSet("Student");
            SqlDataAdapter asdf = new SqlDataAdapter(sql,conn);
            asdf.Fill(ds,"Student");
            dgvqw1.DataSource = ds.Tables["Student"];

        }
        //新增
        private void button5_Click(object sender, EventArgs e)
        {
            frmas3xinzeng frm = new frmas3xinzeng();
            frm.ShowDialog();
            jiazai();
        }
        
        public string stu;
        private void button1_Click(object sender, EventArgs e)
        {
          stu = this.dgvqw1.SelectedCells[1].Value.ToString();
          this.Close();
        
        }

        private void dgvqw1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
        


    }
}
